package com.yu.task.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.task.pojo.Blog;
import com.yu.task.pojo.BlogTagVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BlogMapper extends BaseMapper<Blog> {
/*    @Select("SELECT id,title,content,create_time,update_time, GROUP_CONCAT(name) As tags\n" +
            "from (SELECT b.*,t.name FROM blog AS b\n" +
            "\tLEFT JOIN blog_tag bt ON bt.blog_id = b.id\n" +
            "\tLEFT JOIN tag t ON bt.tag_id = t.id ) bt GROUP BY id ")
    public List<Blog> getBlogTags();

    public List<BlogTagVo> getBlogTagVoList();*/
    Page<BlogTagVo> getBlogTagVoPage(Page<BlogTagVo> pg);

    Page<BlogTagVo> getBlogTagVoPageById(Page<BlogTagVo> pg,Long userId);

}
